package com.chey.service.impl;

import com.chey.dao.BllsDao;
import com.chey.pojo.blls.BELT;
import com.chey.pojo.blls.MSG6;
import com.chey.service.BllsService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class BllsServiceImpl implements BllsService {
    @Resource
    public BllsDao bllsDao;
    @Override
    public Integer insert(MSG6 msg) {

        String blls_uuid=UUID.randomUUID().toString().replace("-","").toLowerCase();

        List<BELT> belts = msg.getDflt().getBELT();
        for (BELT belt :belts) {

        bllsDao.addBlls(belt,blls_uuid);
        }
        bllsDao.add(msg.getMeta(),msg.getDflt(),blls_uuid);
        return null;
    }
}
